home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat4 / mload.z / mload
Encoding:
Text File  |  1998-10-20  |  28.7 KB  |  595 lines

  1.  
  2.  
  3.  
  4. mmmmllllooooaaaadddd((((4444))))                                                              mmmmllllooooaaaadddd((((4444))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      mload - dynamically loadable kernel modules
  10.  
  11. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  12.      IRIX supports dynamic loading and unloading of modules into a running
  13.      kernel.  Kernel modules can be registered and then loaded automatically
  14.      by the kernel when the corresponding device is opened, or they can be
  15.      loaded manually.  Similarly, dynamically loaded modules can be unloaded
  16.      automatically or manually if the module includes an uuuunnnnllllooooaaaadddd entry point.
  17.      A loadable kernel module can be a character, block or streams device
  18.      driver, a streams module, a library module or the _i_d_b_g._o module.
  19.  
  20.    MMMMoooodddduuuulllleeee CCCCoooonnnnffffiiiigggguuuurrrraaaattttiiiioooonnnn
  21.      Each loadable module should contain the string:
  22.  
  23.           _cccc_hhhh_aaaa_rrrr _****_p_r_e_f_i_x_mmmm_vvvv_eeee_rrrr_ssss_iiii_oooo_nnnn _==== _MMMM______VVVV_EEEE_RRRR_SSSS_IIII_OOOO_NNNN_;;;;
  24.  
  25.      M_VERSION is defined in the _m_l_o_a_d._h header file, which should be included
  26.      by the loadable module.
  27.  
  28.      A number of _c_c flags must be defined correctly when compiling loadable
  29.      modules for Irix.  To ensure that you get the correct flags, use the
  30.      sample makefile in /var/sysgen/Makefile.kernloadio from the eoe.hdr.lib
  31.      subsystem.  Instructions for using the makefile are at the beginning of
  32.      the Makefile.kernloadio file.
  33.  
  34.      A loadable module must not be dependent on any loadable module, other
  35.      than a library module.  In order to load a module comprised of multiple
  36.      object files, the object files should be linked together into a single
  37.      object file, using the following _l_d options:  ----GGGG0000 ----rrrr ----dddd
  38.  
  39.    LLLLooooaaaaddddiiiinnnngggg aaaa DDDDyyyynnnnaaaammmmiiiiccccaaaallllllllyyyy LLLLooooaaaaddddaaaabbbblllleeee KKKKeeeerrrrnnnneeeellll MMMMoooodddduuuulllleeee
  40.      Either _l_b_o_o_t or the _m_l command can be used to load, register, unload,
  41.      unregister, and list loadable kernel modules.  The _l_b_o_o_t command parses
  42.      module type, prefix and major number information from the module's master
  43.      file found in the /_v_a_r/_s_y_s_g_e_n/_m_a_s_t_e_r._d directory.  The loadable object
  44.      file is expected to be found in the /_v_a_r/_s_y_s_g_e_n/_b_o_o_t directory.  The _m_l
  45.      command also provides a means of loading, registering and unloading
  46.      loadable modules, without the need for creating a master file or
  47.      reconfiguring the kernel.
  48.  
  49.      Load
  50.           When a module is loaded, the object file's header is read; memory is
  51.           allocated for the module's text, data and bss; the module's text and
  52.           data are read; the module's text and data are relocated and
  53.           unresolved references into the kernel are resolved; a symbol table
  54.           is created for the module; the module is added to the appropriate
  55.           kernel switch table; and the module's init routine is called.
  56.  
  57.           A module is loaded using the following _m_l command:
  58.  
  59.                _mmmm_llll _llll_dddd [_----_vvvv] _----[_cccc_bbbb_BBBB_ffff_mmmm_iiii] _m_o_d_u_l_e._o _----_pppp _p_r_e_f_i_x [_----_ssss _m_a_j_o_r _m_a_j_o_r ...]
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. mmmmllllooooaaaadddd((((4444))))                                                              mmmmllllooooaaaadddd((((4444))))
  71.  
  72.  
  73.  
  74.               [_----_aaaa _m_o_d_n_a_m_e]
  75.  
  76.           If a module is loaded successfully, an id number is returned which
  77.           can be used to unload the module.
  78.  
  79.           A module can also be loaded using _l_b_o_o_t:
  80.  
  81.                _llll_bbbb_oooo_oooo_tttt _----_LLLL _m_a_s_t_e_r
  82.  
  83.      Register
  84.           The register command is used to register a module for loading when
  85.           its corresponding device is opened.  When a module is registered, a
  86.           stub routine is entered into the appropriate kernel switch table.
  87.           When the corresponding device is opened, the module is actually
  88.           loaded.
  89.  
  90.           A module is registered using the following _m_l command:
  91.  
  92.                _mmmm_llll _rrrr_eeee_gggg [_----_vvvv] _----[_cccc_bbbb_BBBB_ffff_mmmm_iiii] _m_o_d_u_l_e._o _----_pppp _p_r_e_f_i_x [_----_ssss _m_a_j_o_r _m_a_j_o_r ...]
  93.                [_----_aaaa _m_o_d_n_a_m_e] [_----_tttt _a_u_t_o_u_n_l_o_a_d__d_e_l_a_y]
  94.  
  95.           If a module is registered successfully, an id number is returned
  96.           which can be used to unregister the module.
  97.  
  98.           A module can also be registered using _l_b_o_o_t:
  99.  
  100.                _llll_bbbb_oooo_oooo_tttt _----_RRRR _m_a_s_t_e_r
  101.  
  102.      Unload
  103.           A module can be unloaded only if it provides an uuuunnnnllllooooaaaadddd entry point.
  104.           A module is unloaded using:
  105.  
  106.                _mmmm_llll _uuuu_nnnn_llll_dddd _i_d [_i_d _i_d ...]
  107.  
  108.           or
  109.  
  110.                _llll_bbbb_oooo_oooo_tttt _----_UUUU _i_d [_i_d _i_d ...]
  111.  
  112.      Unregister
  113.           A module can be unregistered using:
  114.  
  115.                _mmmm_llll _uuuu_nnnn_rrrr_eeee_gggg _i_d [_i_d _i_d ...]
  116.  
  117.           or
  118.  
  119.                _llll_bbbb_oooo_oooo_tttt _----_WWWW _i_d [_i_d _i_d ...]
  120.  
  121.      List
  122.           All loaded and/or registered modules can be listed using:
  123.  
  124.                _mmmm_llll _llll_iiii_ssss_tttt [_----_rrrr_llll_bbbb]
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. mmmmllllooooaaaadddd((((4444))))                                                              mmmmllllooooaaaadddd((((4444))))
  137.  
  138.  
  139.  
  140.           or
  141.  
  142.                _llll_bbbb_oooo_oooo_tttt _----_VVVV
  143.  
  144.    MMMMaaaasssstttteeeerrrr FFFFiiiilllleeee CCCCoooonnnnffffiiiigggguuuurrrraaaattttiiiioooonnnn
  145.      If a dynamically loadable module has an associated master file, the
  146.      master file should include a dddd in Field 1.  The dddd flag indicates to _l_b_o_o_t
  147.      that the module is a dynamically loadable kernel module.  If the dddd flag
  148.      is present _l_b_o_o_t will parse the module's master file, but will not fill
  149.      in the entry in the corresponding kernel switch table for the module.
  150.      All global data defined in the master file will be included in the
  151.      generated _m_a_s_t_e_r._c file.  The kernel should be configured with master
  152.      files that contain the dddd option for each module that will be a
  153.      dynamically loadable module, if _l_b_o_o_t will be used to load, register,
  154.      unload, unregister or autoregister the module.  If the _m_l(1M) command
  155.      will be used, then it is not necessary to create a master file for the
  156.      module.
  157.  
  158.    AAAAuuuuttttoooo RRRReeeeggggiiiissssttttrrrraaaattttiiiioooonnnn
  159.      Loadable modules can be registered by _l_b_o_o_t automatically at system
  160.      startup when autoconfig is run.  In order for a module to be auto-
  161.      registered, its master file should contain an RRRR in Field 1, in addition
  162.      to dddd, which indicates that the module is loadable.  When _l_b_o_o_t runs at
  163.      system startup, it registers each module that contains an RRRR in its master
  164.      file.  Modules which specify a particular major number are registered
  165.      before modules which pick a major number dynamically.  If an rc2 script
  166.      is added, which registers or loads dynamically loadable modules, it
  167.      should be run after the autoconfig rc2 script is run.
  168.  
  169.      For more detailed information, see the _l_b_o_o_t(1M), _m_l(1M), and _m_a_s_t_e_r(4)
  170.      reference pages.
  171.  
  172.    AAAAuuuuttttoooo UUUUnnnnllllooooaaaadddd
  173.      All registered modules that include an uuuunnnnllllooooaaaadddd routine are automatically
  174.      unloaded after last close, unless they have been configured not to.
  175.      Modules are unloaded five minutes after last close by default.  The
  176.      default auto-unload delay can be changed by using _s_y_s_t_u_n_e to change the
  177.      _m_o_d_u_l_e__u_n_l_d__d_e_l_a_y variable.  For more information about systune, see the
  178.      _s_y_s_t_u_n_e(1M) reference page.  A particular module can be configured with a
  179.      specific auto-unload delay by using the _m_l command.  A module can be
  180.      configured to not be auto-unloaded by either placing an NNNN in the flags
  181.      field of its _m_a_s_t_e_r._d file, if it is registered using _l_b_o_o_t, or by using
  182.      _m_l to register the module and using the ----tttt option.
  183.  
  184.    KKKKeeeerrrrnnnneeeellll CCCCoooonnnnffffiiiigggguuuurrrraaaattttiiiioooonnnn
  185.      A kernel which supports loadable modules, should be configured so that
  186.      the kernel switch tables generated by _l_b_o_o_t(1M) contain "extra" entries
  187.      for the loadable modules.  Extra entries are generated by _l_b_o_o_t based on
  188.      the values of the following kernel tuneable parameters:
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. mmmmllllooooaaaadddd((((4444))))                                                              mmmmllllooooaaaadddd((((4444))))
  203.  
  204.  
  205.  
  206.           * name                  default         minimum   maximum
  207.           bbbbddddeeeevvvvsssswwww____eeeexxxxttttrrrraaaa            21              1         254
  208.           ccccddddeeeevvvvsssswwww____eeeexxxxttttrrrraaaa            23              3         254
  209.           ffffmmmmooooddddsssswwww____eeeexxxxttttrrrraaaa            20              0
  210.           vvvvffffsssssssswwww____eeeexxxxttttrrrraaaa              5              0
  211.  
  212.      These tuneable parameters are found in the kernel
  213.      /_v_a_r/_s_y_s_g_e_n/_m_t_u_n_e/_k_e_r_n_e_l file and are set to the defaults listed above.
  214.      For more information about changing tuneable parameters, see the _m_t_u_n_e(4)
  215.      and _s_y_s_t_u_n_e(1M) reference pages.
  216.  
  217.    MMMMoooodddduuuulllleeee EEEEnnnnttttrrrryyyy PPPPooooiiiinnnnttttssss
  218.      Loadable device drivers should conform to the SVR4 DDI/DKI standard.  In
  219.      addition to the entry points specified by the DDI/DKI standard, if a
  220.      loadable module is to be unloaded, the module needs to contain an uuuunnnnllllooooaaaadddd
  221.      entry point:
  222.  
  223.                _iiii_nnnn_tttt _p_r_e_f_i_x_uuuu_nnnn_llll_oooo_aaaa_dddd _((((_vvvv_oooo_iiii_dddd_))))
  224.  
  225.      An uuuunnnnllllooooaaaadddd routine should be treated as an interrupt routine and should
  226.      not call any routines that would cause it to sleep, such as: bbbbiiiioooowwwwaaaaiiiitttt(),
  227.      sssslllleeeeeeeepppp(), ppppsssseeeemmmmaaaa() or ddddeeeellllaaaayyyy().
  228.  
  229.      An uuuunnnnllllooooaaaadddd routine should free any resources allocated by the driver,
  230.      including freeing interrupt vectors and allocated memory and return 0.
  231.  
  232.    MMMMoooodddduuuulllleeee IIIInnnniiiittttiiiiaaaalllliiiizzzzaaaattttiiiioooonnnn
  233.      After a module is loaded, linked into the kernel and sanity checking is
  234.      done, the modules' initialization routines, _p_r_e_f_i_xiiiinnnniiiitttt(), _p_r_e_f_i_xeeeeddddttttiiiinnnniiiitttt()
  235.      and _p_r_e_f_i_xssssttttaaaarrrrtttt() are called, if they exist.  For more information on
  236.      these routines, refer to the SVR4 DDI/DKI Reference Manual and the _I_R_I_X
  237.      _D_e_v_i_c_e _D_r_i_v_e_r _P_r_o_g_r_a_m_m_e_r'_s _G_u_i_d_e.
  238.  
  239.    EEEEddddtttt TTTTyyyyppppeeee DDDDrrrriiiivvvveeeerrrrssss
  240.      For drivers that have an edtinit entry point, which get passed a pointer
  241.      to an edt structure, _l_b_o_o_t must be used to load the driver.  A vector
  242.      line should be added to the system file for the driver, as it would for
  243.      any driver.  When the module is loaded, using _l_b_o_o_t, _l_b_o_o_t parses the
  244.      vector line from the system file to create an edt structure which is
  245.      passed through the kernel and to the driver's edtinit routine.  For more
  246.      information, see the _s_y_s_t_e_m(4) reference page.
  247.  
  248.    LLLLiiiibbbbrrrraaaarrrryyyy MMMMoooodddduuuulllleeeessss
  249.      A library module is a loadable module which contains a collection of
  250.      functions and data that other loaded modules can link against.  A library
  251.      module can be loaded using the following _m_l command:
  252.  
  253.           _mmmm_llll _llll_dddd [_----_vvvv] _----_llll _l_i_b_r_a_r_y._o
  254.  
  255.      A library module must be loaded before other modules that link against it
  256.      are loaded.  Library modules can not be unloaded, registered or
  257.      unregistered.  Only regular object files are supported as loadable
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. mmmmllllooooaaaadddd((((4444))))                                                              mmmmllllooooaaaadddd((((4444))))
  269.  
  270.  
  271.  
  272.      library modules.
  273.  
  274.    TTTThhhheeee iiiiddddbbbbgggg....oooo MMMMoooodddduuuulllleeee
  275.      The _i_d_b_g._o module can be dynamically loaded into a running kernel, so
  276.      that the kernel print utility, _i_d_b_g(1M), can be used without
  277.      reconfiguring and rebooting a new kernel.  The _i_d_b_g._o module can be
  278.      dynamically loaded using the _m_l command:
  279.  
  280.           _mmmm_llll _llll_dddd _----_iiii _////_vvvv_aaaa_rrrr_////_ssss_yyyy_ssss_gggg_eeee_nnnn_////_bbbb_oooo_oooo_tttt_////_iiii_dddd_bbbb_gggg_...._oooo _----_pppp _iiii_dddd_bbbb_gggg
  281.  
  282.      The _i_d_b_g._o module can also be unloaded.
  283.  
  284.      Other idbg modules, such as _x_f_s_i_d_b_g._o, _x_l_v_i_d_b_g._o, _m_l_o_a_d_i_d_b_g._o, and so on,
  285.      can be loaded after _i_d_b_g._o is loaded.  For example:
  286.  
  287.           _mmmm_llll _llll_dddd _----_iiii _////_vvvv_aaaa_rrrr_////_ssss_yyyy_ssss_gggg_eeee_nnnn_////_bbbb_oooo_oooo_tttt_////_xxxx_ffff_ssss_iiii_dddd_bbbb_gggg_...._oooo _----_pppp _xxxx_ffff_ssss_iiii_dddd_bbbb_gggg_...._oooo
  288.  
  289.      For more information, see the _i_d_b_g(1M) reference page.
  290.  
  291.    LLLLooooaaaaddddaaaabbbblllleeee MMMMoooodddduuuulllleeeessss aaaannnndddd HHHHaaaarrrrddddwwwwaaaarrrreeee IIIInnnnvvvveeeennnnttttoooorrrryyyy
  292.      Many device drivers add to the hardware inventory in their init or
  293.      edtinit routines.  If a driver is a dynamically loadable driver and is
  294.      auto-registered, it will not show up in the hardware inventory until the
  295.      driver has been loaded on the first open of the corresponding device.  If
  296.      a clean install or a diskless install is done, a /_d_e_v entry will not get
  297.      created by _M_A_K_E_D_E_V for such a driver since it doesn't appear in the
  298.      hardware inventory.  If such a situation arises, the DDDD _m_a_s_t_e_r._d flag can
  299.      be used to indicate that the driver should be loaded, then unloaded by
  300.      _a_u_t_o_c_o_n_f_i_g.  If the RRRR _m_a_s_t_e_r._d flag, which indicates that the driver
  301.      should be auto-registered, is also used, then the driver will be auto-
  302.      registered as usual.  A startup script can then be added that will run
  303.      _M_A_K_E_D_E_V after _a_u_t_o_c_o_n_f_i_g, if necessary.  For an example, see the
  304.      /_e_t_c/_i_n_i_t._d/_c_h_k_d_e_v startup script.
  305.  
  306.    KKKKeeeerrrrnnnneeeellll RRRRuuuunnnnttttiiiimmmmeeee SSSSyyyymmmmbbbboooollll TTTTaaaabbbblllleeee
  307.      A runtime symbol table which contains kernel routines and global data
  308.      that modules can link against is created from the ELF symbol information
  309.      in the kernel that was booted.  The runtime symbol table is created
  310.      automatically by the kernel from the file indicated by the kkkkeeeerrrrnnnnnnnnaaaammmmeeee
  311.      environment variable, which is set by sash to the name of the file that
  312.      was booted.
  313.  
  314.      The symbol table is loaded with a default auto-unload timeout of five
  315.      minutes, after which the symbol table is automatically unloaded.  The
  316.      symbol table is automatically reloaded when needed to resolve symbols
  317.      (for example when a new or registered module is loaded).
  318.  
  319.      The kernel runtime symbol table can also be loaded manually, using the _m_l
  320.      command:
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. mmmmllllooooaaaadddd((((4444))))                                                              mmmmllllooooaaaadddd((((4444))))
  335.  
  336.  
  337.  
  338.           _mmmm_llll _llll_dddd _----_rrrr _////_uuuu_nnnn_iiii_xxxx
  339.  
  340.      Or unloaded manually:
  341.  
  342.           _mmmm_llll _uuuu_nnnn_llll_dddd _i_d
  343.  
  344.      Note that only one kernel runtime symbol table can exist at one time.
  345.  
  346.      Auto-loading and unloading of the kernel runtime symbol table can be
  347.      disabled using the mmmmllllooooaaaadddd____aaaauuuuttttoooo____rrrrttttssssyyyymmmmssss systune variable.  For more
  348.      information about tuneable variables, see the _s_y_s_t_u_n_e(1M) reference page.
  349.  
  350.    DDDDeeeebbbbuuuuggggggggiiiinnnngggg LLLLooooaaaaddddaaaabbbblllleeee MMMMoooodddduuuulllleeeessss
  351.      _s_y_m_m_o_n(1M) supports debugging of loadable modules.  _s_y_m_m_o_n commands that
  352.      do a symbol table lookup, such as: brk, lkup, lkaddr, hx and nm, also
  353.      search the symbol tables created for loadable modules.  The _m_s_y_m_s command
  354.      can also be used to list the symbols for a particular loaded module:
  355.  
  356.           _mmmm_ssss_yyyy_mmmm_ssss _i_d
  357.  
  358.      The _m_l_i_s_t command can be used to list all of the modules that are
  359.      currently loaded and/or registered.
  360.  
  361.      For more information, see the _s_y_m_m_o_n(1M) reference page.
  362.  
  363.    LLLLooooaaaadddd////RRRReeeeggggiiiisssstttteeeerrrr FFFFaaaaiiiilllluuuurrrreeeessss
  364.      If a registered module fails to load, it is suggested that the module be
  365.      unregistered and then loaded using mmmmllll lllldddd or llllbbbbooooooootttt ----LLLL, in order to get a
  366.      more detailed error message about the failure.  All of the error codes,
  367.      including a description of each, are listed in the _m_l_o_a_d._h header file,
  368.      found in the /_u_s_r/_i_n_c_l_u_d_e/_s_y_s directory.
  369.  
  370.      The kernel will fail to load or register a module for any of the
  371.      following reasons:
  372.  
  373.      1.   If autoconfig is not run at system startup, none of the dynamically
  374.           loadable modules will be registered or loaded.
  375.  
  376.      2.   If autoconfig fails for some reason, before it has processed the
  377.           dynamically loadable module _m_a_s_t_e_r._d files, the modules will not be
  378.           registered or loaded.
  379.  
  380.      3.   The major number specified either in the master file, or by the ml
  381.           command, is already in use.
  382.  
  383.      4.   The object file is not compiled with the correct options, such as
  384.           ----GGGG0000 and ----jjjjaaaallllrrrr.
  385.  
  386.      5.   The module is an "old style" driver, with either xxxdevflag set to
  387.           D_OLD, or no xxxdevflag exists in the driver.
  388.  
  389.  
  390.  
  391.  
  392.  
  393.                                                                         PPPPaaaaggggeeee 6666
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. mmmmllllooooaaaadddd((((4444))))                                                              mmmmllllooooaaaadddd((((4444))))
  401.  
  402.  
  403.  
  404.      6.   A corrupted object file could cause "invalid JMPADDR" errors.
  405.  
  406.      7.   Not all of the module's symbols were resolved by the kernel.
  407.  
  408.      8.   The device switch table is full and has no more room to add a
  409.           loadable driver.
  410.  
  411.      9.   Required entry points for the particular type of module are not
  412.           found in the object file, such as xxxopen for a character device
  413.           driver.
  414.  
  415.      10.  All major numbers are in use.
  416.  
  417.      11.  An old sash is used to boot the kernel, which does not set the
  418.           kkkkeeeerrrrnnnnnnnnaaaammmmeeee environment variable, which indicates the on-disk kernel
  419.           image to load the runtime symbol table from (for example, /_u_n_i_x).
  420.           This will cause all loadable modules to fail to load or be
  421.           registered.  To find out what the kkkkeeeerrrrnnnnnnnnaaaammmmeeee environment variable is
  422.           set to, use the _n_v_r_a_m(1M) command:
  423.  
  424.                _nnnn_vvvv_rrrr_aaaa_mmmm _kkkk_eeee_rrrr_nnnn_nnnn_aaaa_mmmm_eeee
  425.  
  426.      12.  The runtime symbol table can not be loaded from the file indicated
  427.           by the kkkkeeeerrrrnnnnnnnnaaaammmmeeee environment variable, because the file does not
  428.           exist, the file is not the same as the running kernel or the kernel
  429.           was bootp'ed from another machine.
  430.  
  431. EEEEXXXXAAAAMMMMPPPPLLLLEEEE 1111
  432.      The following example lists the steps necessary to build a kernel and
  433.      load a character device driver, called dlkm, using the _l_b_o_o_t command:
  434.  
  435.      1.   Add dddd to the dlkm master file:
  436.  
  437.                *FLAG   PREFIX  SOFT    #DEV    DEPENDENCIES
  438.                cd       dlkm     38      2
  439.  
  440.      2.   Make sure that the cdevsw_extra kernel tuneable parameter allows for
  441.           extra entries in the cdevsw table, the default setting in
  442.           /_v_a_r/_s_y_s_g_e_n/_m_t_u_n_e/_k_e_r_n_e_l is:
  443.  
  444.                cdevsw_extra            23              3         254
  445.  
  446.           The _s_y_s_t_u_n_e(1M) command also lists the current values of all of the
  447.           tuneable parameters.  If the kernel is not configured to allow extra
  448.           entries in the cdevsw table, use the _s_y_s_t_u_n_e command to change the
  449.           cdevsw_extra parameter:
  450.  
  451.                > _ssss_yyyy_ssss_tttt_uuuu_nnnn_eeee _----_iiii
  452.                _ssss_yyyy_ssss_tttt_uuuu_nnnn_eeee_----_>>>> _cccc_dddd_eeee_vvvv_ssss_wwww______eeee_xxxx_tttt_rrrr_aaaa _3333
  453.                _ssss_yyyy_ssss_tttt_uuuu_nnnn_eeee_----_>>>> _qqqq_uuuu_iiii_tttt
  454.                _>>>>
  455.  
  456.  
  457.  
  458.  
  459.                                                                         PPPPaaaaggggeeee 7777
  460.  
  461.  
  462.  
  463.  
  464.  
  465.  
  466. mmmmllllooooaaaadddd((((4444))))                                                              mmmmllllooooaaaadddd((((4444))))
  467.  
  468.  
  469.  
  470.      3.   Build a new kernel and boot the target system with the new kernel.
  471.  
  472.      4.   Compile the _d_l_k_m._c driver.  It should be noted that linking either
  473.           64bit or 32bit objects the "-non_shared" flag is not needed.
  474.  
  475.           For 32-bit modules:
  476.  
  477.                _cccc_cccc _----_nnnn_oooo_nnnn______ssss_hhhh_aaaa_rrrr_eeee_dddd _----_eeee_llll_ffff _----_GGGG_0000 _----_rrrr _----_dddd _----_jjjj_aaaa_llll_rrrr _----_cccc _dddd_llll_kkkk_mmmm_...._cccc
  478.  
  479.           For 64-bit modules:
  480.  
  481.                _cccc_cccc _----_nnnn_oooo_nnnn______ssss_hhhh_aaaa_rrrr_eeee_dddd _----_eeee_llll_ffff _----_GGGG _0000 _----_jjjj_aaaa_llll_rrrr _----_cccc _dddd_llll_kkkk_mmmm_...._cccc
  482.  
  483.      5.   Copy _d_l_k_m._o to /_v_a_r/_s_y_s_g_e_n/_b_o_o_t.
  484.  
  485.      6.   Load the driver into the kernel:
  486.  
  487.                _llll_bbbb_oooo_oooo_tttt _----_LLLL _dddd_llll_kkkk_mmmm
  488.  
  489.      7.   List the currently loaded modules to verify that the module was
  490.           loaded:
  491.  
  492.                _llll_bbbb_oooo_oooo_tttt _----_VVVV
  493.  
  494. EEEEXXXXAAAAMMMMPPPPLLLLEEEE 2222
  495.      The following example lists the steps necessary to load a character
  496.      device driver, called dlkm, using the _m_l command:
  497.  
  498.      1.   Follow step 2 from example 1.
  499.  
  500.      2.   Follow step 4 from example 1.
  501.  
  502.      3.   Load the driver into the kernel:
  503.  
  504.                _mmmm_llll _llll_dddd _----_cccc _dddd_llll_kkkk_mmmm_...._oooo _----_pppp _dddd_llll_kkkk_mmmm _----_ssss _3333_8888
  505.  
  506.           If a major number is not specified, the first free major number in
  507.           the MAJOR table is used.  If the load was successful, an id number
  508.           is returned, which can be used to unload the driver.
  509.  
  510.      4.   List the currently loaded modules to verify that the module was
  511.           loaded:
  512.  
  513.                _mmmm_llll _llll_iiii_ssss_tttt
  514.  
  515. CCCCAAAAVVVVEEEEAAAATTTTSSSS
  516.      1.   Loadable modules must not have any dependencies on loadable modules,
  517.           other than library modules.  When a module is loaded, it is linked
  518.           against the kernel symbol table and any loaded library modules'
  519.           symbol tables, but it is not linked against other modules' symbol
  520.           tables.
  521.  
  522.  
  523.  
  524.  
  525.                                                                         PPPPaaaaggggeeee 8888
  526.  
  527.  
  528.  
  529.  
  530.  
  531.  
  532. mmmmllllooooaaaadddd((((4444))))                                                              mmmmllllooooaaaadddd((((4444))))
  533.  
  534.  
  535.  
  536.      2.   Only character, block and streams device drivers, streams modules
  537.           and library modules are supported as loadable modules at this time.
  538.  
  539.      3.   Old style drivers (devflag set to D_OLD) are not loadable.
  540.  
  541.      4.   Kernel profiling does not support loadable modules.
  542.  
  543.      5.   Memory allocated may be in either K0SEG or in K2SEG.  If the module
  544.           is loaded into K2SEG static buffers are not necessarily in
  545.           physically contiguous memory.  Also, depending on machine
  546.           configuration, K2SEG addresses may map to high physical memory
  547.           addresses, in which case, PHYS_TO_K0 and PHYS_TO_K1 macros will not
  548.           work.
  549.  
  550. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  551.      cc(1), lboot(1M), ld(1), ml(1M), symmon(1M), systune(1M), master(4),
  552.      mtune(4).
  553.  
  554.      _I_R_I_X _D_e_v_i_c_e _D_r_i_v_e_r _P_r_o_g_r_a_m_m_e_r'_s _G_u_i_d_e
  555.  
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.  
  565.  
  566.  
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574.  
  575.  
  576.  
  577.  
  578.  
  579.  
  580.  
  581.  
  582.  
  583.  
  584.  
  585.  
  586.  
  587.  
  588.  
  589.  
  590.  
  591.                                                                         PPPPaaaaggggeeee 9999
  592.  
  593.  
  594.  
  595.